<%@ include file="/jsp/common/tagLibs.jsp"%>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/user/communicationLog.js">
	</script>
	
<DIV class=content_division>
	<DIV class=content_container>
	<DIV class=cleardiv></DIV>
		<DIV class=content_left_shadow>
			<DIV class=content_right_shadow>
				<DIV class=under_flash_shadow></DIV>
				<!-- CONTENT START -->
				<DIV class=content_inner_container>
						   <form:form id="columnarForm" commandName="communicationLogVO" enctype="multipart/form-data">
							<DIV class=cleardiv></DIV>
							<DIV class=maincol style="width:100%;">
							<DIV class=button_orange>
								<DIV class=bo_left></DIV>
								<DIV class=bo_mid>Communication Log</DIV>
								<DIV class=bo_right></DIV>
							</DIV>
							<div style="margin-top:20px;">

								<br>
								<table border="0">
									<tr>
										<td>Select Bank</td>
										<td colspan="2"><form:select id="selectedBankCode" path="selectedBankCode" items="${communicationLogVO.bankDetails}" itemLabel="bankname" itemValue="bankcode"/></td>
									</tr>								
									<tr>
										<sec:authorize ifAnyGranted="ROLE_LBU">
										<td>Add Communication Log</td>
										<td><textarea cols="80" rows="10"  id="communicationLogMessage" name="communicationLogMessage" class="input jFocus" style="height:150px;padding:5px;" onkeypress="if(this.value.length > 500) this.value = this.value.substr(0, 500);"><c:out value="${communicationLogVO.communicationLogMessage}" /></textarea></td>
										</sec:authorize>	
										<sec:authorize ifAnyGranted="ROLE_CBU">
										<td>Add Summary Log</td>
										<td><textarea cols="80" rows="10" id="summaryLogMessage" name="summaryLogMessage" class="input jFocus" style="height:150px;padding:5px;" onkeypress="if(this.value.length > 500) this.value = this.value.substr(0, 500);"><c:out value="${communicationLogVO.summaryLogMessage}" /></textarea></td>
										</sec:authorize>																			
									    <td><input value="Update" type="submit" class="button" id="updateBtn"/></td>		
									</tr>
									<tr>
										<td>Upload File</td>
										<td><form:input path="communicationFile" type="file" cssClass="input jFocus"  cssStyle="height:30px;"/>	</td>
									</tr>								
									<tr>
										<td colspan="3">
										<input type="hidden" name="validation" id="validation"/>
										</td>
									</tr>
								</table>
							</div>
							</div>
							<DIV class=cleardiv></DIV>
							</form:form>  
						   <form id="columnarForm">  
						   		<sec:authorize ifAnyGranted="ROLE_CBU">
								<c:if test="${ not empty communicationLogVO.communicationLog }">
								<div class="sum"> 
								<table>
								<tr>
								<td class="sumtd" colspan="3">
 								   <span>+ </span>Summary Log
 								 </td>
 								 </tr>
 								</table> 
								</div> 
								<div class="sumlog" style="display: none;">
								<table class="table-css">
									<thead>
										<tr><th width="15%">Date</th><th width="15%">Time</th><th width="40%">Summary Log</th><th style="overflow:hidden;max-width:50px;">File Name</th></tr>
									</thead>
									<tbody>
									<c:forEach items="${communicationLogVO.communicationLog}" var="communicationLog" varStatus="status">
										<c:if test="${ not empty communicationLog.summarylog }">
										<tr>
											<td nowrap><fmt:formatDate pattern="dd-MM-yyyy" value="${communicationLog.uploaddate}"/></td>
											<td nowrap><fmt:formatDate type="time" value="${communicationLog.uploaddate}"/></td>																							
											<td style="width:20px;">${communicationLog.summarylog}</td>	
											<td style="overflow:hidden;max-width:50px;">
												<a href="${pageContext.request.contextPath}/communicationlogdetails/viewFile.html?communicationfileid=${communicationLog.communicationfileid}&communicationfilename=${communicationLog.communicationfilename}">${communicationLog.communicationfilename}</a>
											</td>
										</tr>
										</c:if>
									</c:forEach>
									</tbody>
								</table>
								</div>
								</c:if> 
								</sec:authorize>						   
								<c:if test="${ not empty communicationLogVO.communicationLog }">
						   		<sec:authorize ifAnyGranted="ROLE_CBU">	
						   		<br>							
								<div class="comm"> 
								<table>
								<tr>
								<td class="commtd" colspan="3">
 								   <span>+ </span>Communication Log 
 								 </td>
 								 </tr>
 								</table> 								   
								</div> 
								<div class="commlog" style="display: none;">
								</sec:authorize>
								<table class="table-css">
									<thead>
										<tr><th width="15%">Date</th><th width="15%">Time</th><th width="20%">User</th><th style="overflow:hidden;max-width:50px;">Communication Log</th><th style="overflow:hidden;max-width:50px;">File Name</th></tr>
									</thead>
									<tbody>
									<c:forEach items="${communicationLogVO.communicationLog}" var="communicationLog" varStatus="status">
										<c:if test="${ not empty communicationLog.communicationlog }">
										<tr>
											<td nowrap><fmt:formatDate pattern="dd-MM-yyyy" value="${communicationLog.uploaddate}"/></td>
											<td nowrap><fmt:formatDate type="time" value="${communicationLog.uploaddate}"/></td>	
											<td style="width:20px;">${communicationLog.user}</td>																						
											<td style="overflow:hidden;max-width:50px;">${communicationLog.communicationlog}</td>	
											<td style="overflow:hidden;max-width:50px;">
												<a href="${pageContext.request.contextPath}/communicationlogdetails/viewFile.html?communicationfileid=${communicationLog.communicationfileid}&communicationfilename=${communicationLog.communicationfilename}">${communicationLog.communicationfilename}</a>
											</td>
										</tr>
										</c:if>
									</c:forEach>
									</tbody>
								</table>
						   		<sec:authorize ifAnyGranted="ROLE_CBU">									
								</div>
								</sec:authorize>								
								</c:if>  
							</form> 	
							<br/><br/><br/>
						</DIV>
				<!-- CONTENT END -->
			</DIV>
		</DIV>
		<DIV class=cleardiv></DIV>
	</DIV>
</DIV>